package com.smartao.base.role;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.smartao.core.service.BaseService;

@Transactional(readOnly=true)
public interface RoleService extends BaseService<Role, Long> {

	/**
	 * 根据role_key查询唯一Role
	 * @param roleAdmin
	 * @return
	 */
	Role findByRoleKey(String roleKey);
	
	/**
	 * 根据角色类型获取角色列表;
	 * @param roleTypeId 角色类型选择项Id
	 * @return
	 */
	List<Role> findByRoleType(Long roleTypeId);
	
	/**
	 * 查找Role并连带取出Users.
	 * @param roleId
	 * @return
	 */
	Role findRoleAndUser(Long roleId);
	
	/**
	 * 添加用户到某角色
	 * @param employeeId
	 * @param roleId
	 */
	void addUserToRole(Long roleId, Long[] employeeIds);

}
